﻿<!doctype html>
<html class="no-js" lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
      layout:decorate="~{/layout/layout}">
<head>
<body>
<div id="content" layout:fragment="content">

    <div class="container">
        <div class="row">
            <div class="col-lg-3 col-md-3 hidden-sm hidden-xs">
                <ul class="list-group">
                    <li class="list-group-item">
                        <a href="/user/information" class="list-group-item">
                            个人信息
                        </a>
                    </li>
                    <li class="list-group-item">
                        <a href="/user/to" class="list-group-item">
                            密码修改
                        </a>
                    </li>
                    <li class="list-group-item">
                        <a href="/address/do" class="list-group-item">
                            收货地址
                        </a>
                    </li>
                    <li class="list-group-item">
                        <a href="/ordergroup/order" class="list-group-item">
                            订单管理
                        </a>
                    </li>
                </ul>
            </div>
            <div class="col-lg-6 col-md-6 col-sm-12">

                <!-- <label class="sr-only" for="inputHelpBlock">Input with help text</label>
                    <input type="text" id="inputHelpBlock" class="form-control" aria-describedby="helpBlock"> -->
                <h3>收货地址</h3>
                <!-- <form >
                    <div class="control-group">
                      <label class="control-label" for="inputIcon">Email</label>
                       <input type="email" class="form-control" id="exampleInputEmail1" placeholder="Email">
                    </div>
                        <button type="submit" class="btn btn-primary">保存</button>
                 </form> -->
                <br>
                <form action="/address/doaddress" method="post">
                    <div class="info">
                        <br>
                        <select class="form-control" id="s_province" name="s_province"></select>
                        <br>
                        <select class="form-control" id="s_city" name="s_city"></select>
                        <br>
                        <select class="form-control" id="s_county" name="area"></select>

                        <br>
                        <input type="text" class="form-control" name="content" value="" placeholder="详细地址:" required/>
                        <br>
                        <input type="text" class="form-control" name="postcode" value="" placeholder="邮编:" required/>
                        <br>
                        <input type="text" class="form-control" name="phone" value="" placeholder="手机号:" required/>
                        <br>
                        <input type="text" class="form-control" name="people" value="" placeholder="收件人:" required/>
                        <br>

                        <input type="checkbox" style="width: 20px;display: block;" name="defaultAddress">
                        <p style="margin-top: -35px;margin-left: 26px;">设置为默认地址</p>


                        <button type="submit" class="btn btn-primary" style="float: right;">保存</button>

                        <script type="text/javascript"></script>
                        <script src="/js/area.js"></script>
                        <div id="show"></div>
                    </div>

                </form>
            </div>
            <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12">

            </div>
        </div>


    </div>

</div>
<script layout:fragment="script">
    var config = {pageTitle: "收货地址", navActive: "navProduct"};
    var cartId = 0;
    $(function () {
        document.title = config.pageTitle;
        $("#" + config.navActive).addClass("active");
    });
    _init_area();
    var Gid = document.getElementById('s_county');
    var showArea = function () {
        document.getElementById('show').innerHTML = "<h3>省" + document.getElementById('s_province').value + " - 市" +
            document.getElementById('s_city').value + " - 县/区" +
            document.getElementById('s_county').value + "</h3>"
    };
    Gid.setAttribute('onchange', 'showArea()');
</script>
</body>
</html>